﻿<Window x:Class="KegManager.PourWindow"
        x:Name="pourWindow"
        xmlns:my="clr-namespace:KegManager"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="PourWindow" Height="300" Width="300" WindowStyle="None" WindowStartupLocation="CenterScreen" AllowsTransparency="True" Background="Transparent">
    <Window.Resources>
        <my:SmallVolumeConverter x:Key="SmallVolumeConverter" />
        <my:UserImageConverter x:Key="UserImageConverter" />
    </Window.Resources>
    <Window.Triggers>
        <!--<EventTrigger RoutedEvent="Window.Loaded">
            <BeginStoryboard>
                <Storyboard Name="FormFade">
                    <DoubleAnimation  Name="FormFadeAnimation"
                                            Storyboard.TargetName="pourWindow"
                                            Storyboard.TargetProperty="(Window.Opacity)"
                                            From="0.0" To="1.0" Duration="0:0:.5"
                                            AutoReverse="False" RepeatBehavior="1x"
                                         />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>-->

        <!--<EventTrigger RoutedEvent="Window.Unloaded">
            <BeginStoryboard>
                <Storyboard Name="FormFadeOut" Completed="FormFadeOut_Completed">
                    <DoubleAnimation  Name="FormFadeOutAnimation"
                                            Storyboard.TargetName="pourWindow"
                                            Storyboard.TargetProperty="(Window.Opacity)"
                                            From="1.0" To="0.0" Duration="0:0:.5"
                                            AutoReverse="False" RepeatBehavior="1x"
                                         />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>-->
    </Window.Triggers>
    <Border BorderBrush="Black" BorderThickness="2,2,2,2" CornerRadius="2,2,2,2" Background="White">
        <Grid Margin="10,10,10,10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="50" />
                <RowDefinition Height="*" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" HorizontalAlignment="Center" FontSize="18" Text="{Binding ElementName=pourWindow, Path=Tap.Keg.Beer.Name}">
                <TextBlock Text=" on Tap "/>
                <TextBlock Text="{Binding ElementName=pourWindow, Path=Tap.Position}" />
            </TextBlock>
            <TextBlock Grid.Row="1" HorizontalAlignment="Center" FontSize="24" Text="{Binding ElementName=pourWindow, Path=User.Name}" />
            <TextBlock Grid.Row="2" Name="textVolume" Text="{Binding ElementName=pourWindow, Path=Volume, Converter={StaticResource SmallVolumeConverter},ConverterParameter=#0.00}" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" FontSize="72" />
            <Image Grid.Row="3" Source="{Binding ElementName=pourWindow, Path=User.AvatarImage, Converter={StaticResource UserImageConverter}}" Height="100" />
        </Grid>
    </Border>
</Window>
